<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 实现一个梯形 -->
    <style>
        .trapezoid {
            width: 200px;
            height: 100px;
            background-color: red;
            /* clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%); */
            /* transform: rotate(90deg);
            transform-origin: center center;  */
            clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
        }

        .trapezoid-border {
            margin-top: 100px;
            width: 204px;
            /* 边框宽度加上实际宽度 */
            height: 104px;
            /* 边框高度加上实际高度 */
            position: relative;
            background-color: blue;
            /* 边框颜色 */
            clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
         
        }

        .trapezoid-fill {
            width: 200px;
            /* 实际宽度 */
            height: 100px;
            /* 实际高度 */
            background-color: red;
            /* 填充颜色 */
            position: absolute;
            top: 2px;
            /* 边框厚度的一半 */
            left: 2px;
            /* 边框厚度的一半 */
            clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
         
        }
    </style>
</head>

<body>

    <div class="trapezoid"></div>

    <div class="trapezoid-border">
        <div class="trapezoid-fill"></div>
    </div>

</body>

</html>